﻿using System.Collections.Generic;
using System.Text;

namespace TripleA.Core
{
    public static class StringEx
    {
         public static StringBuilder AppendFormatNotNullOrWhitespace(this StringBuilder builder, string format, string value, params object[] args)
         {
             if (!string.IsNullOrWhiteSpace(value))
             {
                 var items = new List<object> {value};
                 items.AddRange(args);
                 builder.AppendFormat(format, items.ToArray());
             }
             return builder;
         }
    }
}